package com.teame.readbaby.util;

import android.os.Handler;

public class DptAsyncTask {

	private DptListener dl;
	public DptAsyncTask(DptListener dl){
		this.dl=dl;
	}
	
	private Handler handler = new Handler(){
		public void handleMessage(android.os.Message msg) {
			dl.after();
		};
	};
		public interface DptListener{
		void before();
		void doinbackground();
		void after();
	}
	
	public void execute(){
		dl.before();
		new Thread(){
			public void run() {
				dl.doinbackground();

				
				//����˯��1��
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				
				handler.sendEmptyMessage(1);
			};
		}.start();
	}
	
}
